<div class="main-container" id="main-container">
    <div class="main-container-inner">
        <div class="main-content">
            <div class="page-content">
                <div class="row">
                    <form class="form-horizontal"  role="form" id="add_form" >
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="userAccount" class="col-sm-3 control-label">用户账号</label>
                                <div class="col-sm-7">
                                    <input type="text" class="form-control" id="userAccount" name="userAccount" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="userPassword" class="col-sm-3 control-label">用户密码</label>
                                <div class="col-sm-7">
                                    <input type="text" class="form-control" id="userPassword" name="userPassword" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="userName" class="col-sm-3 control-label">真实姓名</label>
                                <div class="col-sm-7">
                                    <input type="text" class="form-control" id="userName" name="userName" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="userIdNumber" class="col-sm-3 control-label">身份证号</label>
                                <div class="col-sm-7">
                                    <input type="text" class="form-control" id="userIdNumber" name="userIdNumber" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="userSex" class="col-sm-3 control-label">性  别</label>
                                <div class="col-sm-7">
                                    <select class="form-control" id="userSex" name="userSex">
                                        <option value="1">男</option>
                                        <option value="0">女</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="rentCode" class="col-sm-3 control-label">所属客户</label>
                                <div class="col-sm-7">
                                    <select class="form-control" id="rentCode" name="rentCode" onchange="changeValue()">
                                        <option value="-1">-----请选择客户-----</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="isMarry" class="col-sm-3 control-label">是否结婚</label>
                                <div class="col-sm-7">
                                    <select class="form-control" id="isMarry" name="isMarry">
                                        <option value="1">否</option>
                                        <option value="0">是</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="userPhone" class="col-sm-3 control-label">联系方式</label>
                                <div class="col-sm-7">
                                    <input type="text" class="form-control" id="userPhone" name="userPhone" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="userQqNumber" class="col-sm-3 control-label">QQ号码</label>
                                <div class="col-sm-7">
                                    <input type="text" class="form-control" id="userQqNumber" name="userQqNumber" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="userEmail" class="col-sm-3 control-label">联系邮箱</label>
                                <div class="col-sm-7">
                                    <input type="text" class="form-control" id="userEmail" name="userEmail" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="userAddress" class="col-sm-3 control-label">联系地址</label>
                                <div class="col-sm-7">
                                    <input type="text" class="form-control" id="userAddress" name="userAddress" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="orgCode" class="col-sm-3 control-label">所属机构</label>
                                <div class="col-sm-7">
                                    <select class="form-control" id="orgCode" name="orgCode">
                                    </select>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        ajaxs('./DRent/getRentKeyValue', 'GET', null, true, function (typedata) {
            for (var i = 0; i < typedata.length; i++) {
                $("#rentCode").append("<option value=" + typedata[i].key + ">" + typedata[i].value + "</option>")
            }
        });
    });
    function form_sub() {
        ajaxs('./DUser', 'POST',$("#add_form").serialize(), true, function(data){
                $("#im_unique_dlg").modal('hide');
                layer.msg(data.message);
                $("#rentTable table").bootstrapTable('refresh');
        });
    }
    function changeValue(){
        $("#orgCode").find("option").remove();
        ajaxs('./DOrg/getOrgList/'+$("#rentCode").val(), 'GET', null, true, function (typedata) {
            for (var i = 0; i < typedata.length; i++) {
                $("#orgCode").append("<option value=" + typedata[i].key + ">" + typedata[i].value + "</option>")
            }
        });
    }
</script>